package com._4cmd.store.connection;


import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public interface ConnectionPool {
	
	/**
	 * get the connection which has the default AutoCommit configuration
	 * @return Connection
	 * @throws SQLException
	 */
	public Connection getConnection()throws Exception;
	
	/**
	 * get the connection
	 * @param isAutoCommit the connection is or not commit automatically
	 * @throws SQLException
	 */
	public Connection getConnection(boolean isAutoCommit)throws Exception;
	
	/**
	 * 
	 * @param conn
	 */
	public void rollBack(Connection conn);
	
	/**
	 * close the connection 
	 * @param conn
	 */
	public void close(Connection conn);
	
	/**
	 * close the connection & PreparedStatement & ResultSet
	 * @param conn
	 * @param stmt
	 * @param rs
	 */
	public void close(Connection conn, PreparedStatement stmt, ResultSet rs);

	
	/**
	 * close the connection & PreparedStatement
	 * @param conn
	 * @param stmt
	 */
	public void close(Connection conn, PreparedStatement stmt);
	
	/**
	 * 
	 * @param stmt
	 * @param rs
	 */
	public void close(PreparedStatement stmt ,ResultSet rs);
	
	/**
	 * close the ResultSet 
	 * @param rs
	 */
	public void close(ResultSet rs);
	
	/**
	 * close the PreparedStatement 
	 * @param stmt
	 */
	public void close(PreparedStatement stmt);

}
